﻿using Microsoft.Practices.Unity;

namespace FoosballEye.Repository
{
    /// <summary>
    /// Used to Dependency Injection in JSONDataController
    /// </summary>
    public class ModelContainer
    {
        private static IUnityContainer _Instance;

        static ModelContainer()
        {
            _Instance = new UnityContainer();
        }

        public static IUnityContainer Instance
        {
            get 
            { 
                //Resolves Interface to Class
                _Instance.RegisterType<IPlayerRepository, PlayerRepository>(new HierarchicalLifetimeManager());
                _Instance.RegisterType<IGameRepository, GameRepository>(new HierarchicalLifetimeManager());
                return _Instance;
            }
        }
    }
}
